package com.app.utils;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * SQLite Open Helper
 */
public class MySQLiteOpenHelper extends SQLiteOpenHelper {

    // 数据库版本
    private static final int DATABASE_VERSION = 1;
    // 数据库名
    private static final String DATABASE_NAME = "talk";
    // 存放缓存数据表名
    private final String SQLITE_CACHE_TABLE_NAME = "t_sqlite_cache";

    public MySQLiteOpenHelper(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("CREATE TABLE " + SQLITE_CACHE_TABLE_NAME + "(id INTEGER PRIMARY KEY AUTOINCREMENT,key varchar not null,source VARCHAR NOT NULL,className VARCHAR NOT NULL,type INTEGER)");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
